package java_io.autoclose;

public class TestFinallyBlock {

	public static void main(String[] args) {
		try{
			System.out.println("main");
			test();
		}catch(RuntimeException ex){
			System.out.println("main : catch block");
		}
		
		System.out.println("main finished");

	}
	
	static void test(){
		try{
			System.out.println("test: try block");
			exception();
		}finally {
			System.out.println("test: finally block");
		}
	}
	static void exception() {
		throw new RuntimeException("exception");
	}
}
